home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1237 / sample.dcg < prev   
Text File  |  1997-04-18  |  17KB  |  564 lines

  1. $[// SAMPLE.DCG - Sample dCG Script for Generic SDK Application]$
  2. $[// rncbc (c) 1996, Copyright by Rui Capela]$
  3. $[//****************************************]$
  4. $[//*** Application Specification Dialog ***]$
  5. $[//****************************************]$
  6. $[dialog AppGenDlg, "New Application", 50, 50, 198, 172]$
  7.     $[control NameLbl,   Text,         "Application &Name:", 4,  4,  64,  8]$
  8.     $[control AppName,   Edit,         "",                   4, 14,  64, 12]$
  9.     $[control TargetLbl, Text,         "Tar&get:",          72,  4,  66,  8]$
  10.     $[control Target,    DropListBox,  "",                  72, 14,  66, 32]$
  11.     $[control DirLbl,    Text,         "&Directory:",        4, 30, 134,  8]$
  12.     $[control AppDir,    Edit,         "",                   4, 40, 134, 12]$
  13.     $[control Browse,    PushButton,   "&Browse...",       148, 40,  46, 14]$
  14.     $[control TitleLbl,  Text,         "&Title:",            4, 56, 190,  8]$
  15.     $[control AppTitle,  Edit,         "",                   4, 66, 190, 12]$
  16.     $[control VersLbl,   Text,         "&Version:",          4, 82,  30,  8]$
  17.     $[control AppVersid, Edit,         "",                   4, 92,  30, 12]$
  18.     $[control AuthLbl,   Text,         "&Author:",          38, 82, 156,  8]$
  19.     $[control AppAuthor, Edit,         "",                  38, 92, 156, 12]$
  20.     $[control InfoLbl,   Text,         "&Info:",             4,108, 190,  8]$
  21.     $[control AppInfo,   MLEdit,       "",                   4,118, 190, 50]$
  22.     $[control Ok,        OkButton,     "OK",               148,  4,  46, 14]$
  23.     $[control Cancel,    CancelButton, "Cancel",           148, 22,  46, 14]$
  24. $[end dialog]$
  25. $[AppGenDlg.Target.Items = list("Windows 3.x", "Win32")]$
  26. $[//*** Application Info (Default) ***]$
  27. $[AppName      = "App1"]$
  28. $[AppDir       = curdir()]$
  29. $[AppVersid    = "0.01a"]$
  30. $[AppTitle     = AppName + " Application"]$
  31. $[AppAuthor    = "rncbc"]$
  32. $[AppInfo      = "Written by: " + AppAuthor]$
  33. $[AppCopyright = "Copyright (c) " + left(date(), 4) + ", " + AppAuthor]$
  34. $[// *** Application Definition Persistence ***]$
  35. $[SaveFile = dcgdir() + "\Sample.sav"]$
  36. $[if exist(SaveFile)]$
  37.     $[AppGenDlg = loaditem(SaveFile)]$
  38.     $[if (!isobject(AppGenDlg))]$
  39.         $[msgbox("Error", "The dialog settings could not be loaded from " + SaveFile, 16)]$
  40.         $[return]$
  41.     $[endif]$
  42. $[else]$
  43.     $[//*** Application Dialog Loop ***]$
  44.     $[AppGenDlg.AppName.Text   = AppName]$
  45.     $[AppGenDlg.AppDir.Text    = AppDir]$
  46.     $[AppGenDlg.AppTitle.Text  = AppTitle]$
  47.     $[AppGenDlg.AppVersid.Text = AppVersid]$
  48.     $[AppGenDlg.AppAuthor.Text = AppAuthor]$
  49.     $[AppGenDlg.AppInfo.Text   = AppInfo.replace("\n", chr(13) + chr(10))]$
  50. $[endif // !exist]$
  51. $[// *** Application Dialog Loop ***]$
  52. $[Done = FALSE]$
  53. $[while (!Done)]$
  54.     $[dialog AppGenDlg]$
  55.     $[if (!AppGenDlg.Result)]$
  56.         $[return]$
  57.     $[endif]$
  58.     $[// Browse button has been selected?]$
  59.     $[if (AppGenDlg.Browse.Select)]$
  60.         $[Dir = DirDialog("New Application Directory")]$
  61.         $[if (Dir != "")]$
  62.             $[AppGenDlg.AppDir.Text = Dir]$        
  63.         $[endif]$
  64.     $[else]$
  65.         $[// Validate dialog results.]$
  66.         $[AppGenDlg.AppName.Text.strip().left(8)]$
  67.         $[AppGenDlg.AppDir.Text.trim()]$
  68.         $[select]$
  69.             $[case AppGenDlg.AppName.Text = ""]$
  70.                 $[MsgBox("New Application", "Invalid Application Name.", 48)]$
  71.             $[case AppGenDlg.AppDir.Text = ""]$
  72.                 $[MsgBox("New Application", "Invalid Application Directory.", 48)]$
  73.             $[otherwise]$
  74.                 $[Done = TRUE]$
  75.         $[endselect]$
  76.     $[endif]$
  77. $[end while]$ 
  78. $[//*** Application Info (from dialog) ***]$
  79. $[AppName  = AppGenDlg.AppName.Text]$
  80. $[AppDir   = AppGenDlg.AppDir.Text]$
  81. $[AppTitle = AppGenDlg.AppTitle.Text]$
  82. $[AppInfo  = AppGenDlg.AppInfo.Text]$
  83. $[AppInfo.replace(chr(13) + chr(10), "\n")]$
  84. $[//*** Application Path (include trailing slash) ***]$
  85. $[AppPath = AppDir]$
  86. $[if right(AppPath, 1) != "\"]$
  87.     $[AppPath = AppPath + "\"]$
  88. $[endif]$
  89. $[//*** Filenames to be generated ***]$
  90. $[AppHdrFile = AppName + ".h"       // Main application header file]$
  91. $[AppSrcFile = AppName + ".c"       // Main application source file]$
  92. $[AppRrcFile = AppName + ".rc"      // Resource file]$
  93. $[AppDefFile = AppName + ".def"     // Definition file]$
  94. $[//*******************************************]$
  95. $[//*** Common source file header Procedure ***]$
  96. $[//*******************************************]$
  97. $[procedure AppHeader ( name, lbegin )]$
  98. $[lbegin]$
  99. $[pad(lbegin, 4) + pad(upper(name), 12)]$ $[AppTitle]$ 
  100. $[pad(lbegin, 16)]$ Version $[AppVersid]$ 
  101. $[lbegin]$
  102. $[pad(lbegin, 16)]$ $[AppCopyright]$
  103. $[pad(lbegin, 16)]$ All rights reserved.
  104. $[lbegin]$
  105. $[pad(lbegin, 4)]$Generated by dCG v$[dcgversion()]$ on $[picture(date(), "@Ddd-mm-yyyy")]$ $[time()]$.
  106. $[lbegin]$
  107. $[return]$
  108. $[end procedure]$
  109. $[//************************************]$
  110. $[//*** Main application header file ***]$
  111. $[//************************************]$
  112. $[output AppPath + AppHdrFile]$
  113. $[AppHeader(AppHdrFile, "/" + "/")]$
  114. //  Main $[AppName]$ application header file.
  115. //  
  116.  
  117. #ifndef __$[upper(AppName)]$_H
  118. #define __$[upper(AppName)]$_H
  119.  
  120. // Common includes.
  121. #include <windows.h>
  122.  
  123. //
  124. //  Application Resource Identifiers.
  125. //
  126.  
  127. // Accelerator id.
  128. #define IDA_$[upper(AppName)]$ACCEL   100
  129.  
  130. // Menu ids.
  131. $[MenuID = 100]$
  132. #define IDM_$[upper(AppName)]$MENU    $[MenuID]$
  133.  
  134. $[ItemID = 101]$
  135. #define IDM_FILEEXIT    $[ItemID]$
  136. $[ItemID = ItemID + 1]$
  137. #define IDM_HELPABOUT   $[ItemID]$
  138.  
  139.  
  140. //
  141. //  Dialog related ids.
  142. //
  143.  
  144. $[DlgID = 100]$
  145. #define IDD_$[upper(AppName)]$ABOUT    $[DlgID]$
  146.  
  147. $[CtlID = 101]$
  148. #define IDC_$[upper(AppName)]$ABOUTNAME        $[CtlID]$
  149. $[CtlID = CtlID + 1]$
  150. #define IDC_$[upper(AppName)]$ABOUTCOMPANY     $[CtlID]$
  151. $[CtlID = CtlID + 1]$
  152. #define IDC_$[upper(AppName)]$ABOUTBUILD       $[CtlID]$
  153.  
  154. // $[PROTECT AppName + "UserDefs"]$
  155. // User Definitions.
  156. // $[ENDPROTECT]$
  157.  
  158. #endif  // __$[upper(AppName)]$_H
  159.  
  160. // end of $[upper(AppHdrFile)]$
  161. $[//************************************]$
  162. $[//*** Main application source file ***]$
  163. $[//************************************]$
  164. $[output AppPath + AppSrcFile]$
  165. $[AppHeader(AppSrcFile, "/" + "/")]$
  166. //  Main $[AppName]$ application source file.
  167. //   
  168.  
  169. #include "$[AppHdrFile]$"
  170.  
  171. // Stuff passed in WinMain.
  172. HINSTANCE g_hInstance     = 0;
  173. HINSTANCE g_hPrevInstance = 0;
  174. LPSTR     g_lpszCmdLine   = 0;
  175. int       g_nCmdShow      = 0;
  176.  
  177. // Main window class name and title.
  178. char g_szMainClass[] = "$[AppName + "Frame"]$";
  179. char g_szMainTitle[] = "$[AppTitle]$";
  180.  
  181. // Main window handle.
  182. HWND g_hwndMain = 0;
  183.  
  184. // Accelerator table handle.
  185. HACCEL g_haccel = 0;
  186.  
  187. // Function prototypes.
  188. BOOL InitApplication (void);
  189. BOOL AboutDlg        (void);
  190. BOOL MainOnCommand   (int iItem);
  191.  
  192. // Windows/dialog procedures.
  193. LRESULT CALLBACK _export MainWndProc  (HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
  194. BOOL    CALLBACK _export AboutDlgProc (HWND hdlg, UINT uiMessage, WPARAM wParam, LPARAM lParam);
  195.  
  196. // $[PROTECT AppName + "UserDecls"]$
  197. // Global user definitions.
  198. // $[ENDPROTECT]$
  199.  
  200.  
  201. //
  202. //  AboutDlg
  203. //
  204. //  Show About dialog.
  205. //
  206.  
  207. BOOL AboutDlg (void)
  208. {
  209.     DLGPROC lpDlgProc;
  210.     int     iRetCode;
  211.  
  212.     // Create a modal dialog box
  213. #ifdef WIN32
  214.     lpDlgProc = (DLGPROC) AboutDlgProc;
  215. #else
  216.     lpDlgProc = (DLGPROC) MakeProcInstance((FARPROC) AboutDlgProc, g_hInstance);
  217. #endif
  218.                               
  219.     // And really start the modal dialog!
  220.     iRetCode = (int) DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_$[upper(AppName)]$ABOUT), g_hwndMain, (DLGPROC) lpDlgProc);
  221.  
  222. #ifndef WIN32
  223.     FreeProcInstance((FARPROC) lpDlgProc);
  224. #endif
  225.  
  226.     // Return code...
  227.     return (BOOL) iRetCode;
  228. }
  229.  
  230.  
  231. //
  232. //  AboutDlgProc
  233. //
  234. //  About dialog procedure.
  235. //
  236.  
  237. BOOL CALLBACK _export AboutDlgProc ( HWND hdlg, UINT uiMessage, WPARAM wParam, LPARAM lParam )
  238. {
  239.     switch (uiMessage) {
  240.  
  241.       case WM_INITDIALOG:
  242.       {
  243.         // Just format the build date.
  244.         char szBuild[80];
  245.  
  246.         lstrcpy(szBuild, __DATE__);
  247.         lstrcat(szBuild, "  ");
  248.         lstrcat(szBuild, __TIME__);
  249.  
  250.         SetDlgItemText(hdlg, IDC_$[upper(AppName)]$ABOUTBUILD, szBuild);
  251.         break;
  252.       }
  253.  
  254.       case WM_COMMAND:
  255.       {
  256. #ifdef WIN32
  257.         int iCtlID = (int) LOWORD(wParam);
  258. #else
  259.         int iCtlID = (int) wParam;
  260. #endif
  261.         if (iCtlID == IDOK || iCtlID == IDCANCEL)
  262.             EndDialog(hdlg, 0);
  263.         break;
  264.       }
  265.  
  266.       // $[PROTECT AppName + "AboutDlgCommands"]$
  267.       // User AboutDlg Commands.
  268.       // $[ENDPROTECT]$
  269.  
  270.       default:
  271.         // Any other dialog message?
  272.         return FALSE;
  273.     }
  274.  
  275.     // We've handled it!
  276.     return TRUE;
  277. }
  278.  
  279.  
  280. //
  281. //  MainOnCommand
  282. //
  283. //  Main window command handler.
  284. //
  285.  
  286. BOOL MainOnCommand ( int iItem  )
  287. {
  288.     switch (iItem) {
  289.  
  290.       case IDM_FILEEXIT:
  291.         // Destroy main window and quit application.
  292.         DestroyWindow(g_hwndMain);
  293.         break;
  294.  
  295.       case IDM_HELPABOUT:
  296.         // Show about dialog box.
  297.         AboutDlg();
  298.         break;
  299.  
  300.       // $[PROTECT AppName + "MainCommands"]$
  301.       // User Main Window Commands.
  302.       // $[ENDPROTECT]$
  303.  
  304.       default:
  305.         // Command not handled.
  306.         return FALSE;
  307.     }
  308.     
  309.     // Command has been handled.
  310.     return TRUE;
  311. }
  312.  
  313.  
  314. //
  315. //  MainWndProc
  316. //
  317. //  Main window procedure.
  318. //
  319.  
  320. LRESULT CALLBACK _export MainWndProc ( HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam )
  321. {
  322.      switch (uiMessage) {
  323.  
  324.       case WM_COMMAND:
  325.       {
  326. #ifdef WIN32
  327.         WORD wCode = HIWORD(wParam);
  328.         int  iItem = (int) LOWORD(wParam);
  329. #else
  330.         WORD wCode = HIWORD(lParam);
  331.         int  iItem = (int) wParam;
  332. #endif
  333.         // See if it's from a menu bar or accelerator...
  334.         if (wCode == 0 || wCode == 1)
  335.             return (LRESULT) MainOnCommand(iItem);
  336.         break;
  337.       }
  338.  
  339.       case WM_DESTROY:
  340.         // Terminate application.
  341.         PostQuitMessage(0);
  342.         break;
  343.  
  344.       // $[PROTECT AppName + "MainMessages"]$
  345.       // User Main Window Message handling.
  346.       // $[ENDPROTECT]$
  347.  
  348.       default:
  349.         // Other messages processing.
  350.         break;
  351.     }
  352.  
  353.     // Default Windows dispatcher if not handled..
  354.     return DefWindowProc(hwnd, uiMessage, wParam, lParam);
  355. }
  356.  
  357.  
  358. //
  359. //  InitApplication
  360. // 
  361. //  Register main window class.
  362. //
  363.  
  364. BOOL InitApplication (void)
  365. {
  366.     WNDCLASS wc;
  367.  
  368.     // Load accelerator table.
  369.     g_haccel = LoadAccelerators(g_hInstance, MAKEINTRESOURCE(IDA_$[upper(AppName)]$ACCEL));
  370.  
  371.     // Check if window class is alredy registered.
  372.     if (GetClassInfo(g_hInstance, g_szMainClass, &wc))
  373.         return TRUE;
  374.  
  375.     // Fill out window class sttrcuture.
  376.     wc.style         = CS_DBLCLKS;
  377.     wc.lpfnWndProc   = (WNDPROC) MainWndProc;
  378.     wc.cbClsExtra    = 0;
  379.     wc.cbWndExtra    = 0;
  380.     wc.hInstance     = g_hInstance;
  381.     wc.hIcon         = 0;
  382.     wc.hCursor       = LoadCursor(0, IDC_ARROW);
  383.     wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
  384.     wc.lpszMenuName  = MAKEINTRESOURCE(IDM_$[upper(AppName)]$MENU);
  385.     wc.lpszClassName = g_szMainClass;
  386.  
  387.     return RegisterClass(&wc);
  388. }
  389.  
  390.  
  391. // 
  392. //  WinMain - Main Windows entry point.
  393. //
  394.  
  395. int PASCAL WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow )
  396. {
  397.     // Initialize application.
  398.     g_hInstance     = hInstance;
  399.     g_hPrevInstance = hPrevInstance;
  400.     g_lpszCmdLine   = lpszCmdLine;
  401.     g_nCmdShow      = nCmdShow;
  402.  
  403.     // Initialize this application instance.
  404.     if (!InitApplication())
  405.         return 0;
  406.  
  407.     // Create main window.
  408.     g_hwndMain = CreateWindowEx(
  409.                      0L,            // Window extended style.
  410.                      g_szMainClass, // Registered class name.
  411.                      g_szMainTitle, // Window title.
  412.                      WS_OVERLAPPEDWINDOW, // Window style.
  413.                      CW_USEDEFAULT, // Horizontal position of window.
  414.                      CW_USEDEFAULT, // Vertical position of window.
  415.                      CW_USEDEFAULT, // Window width.
  416.                      CW_USEDEFAULT, // Window height.
  417.                      NULL,          // Handle of parent window.
  418.                      NULL,          // Handle of menu or child id.
  419.                      g_hInstance,   // Application instance.
  420.                      NULL           // Window creation data (none).
  421.                  );
  422.  
  423.     // Check if window has been properly created.
  424.     if (g_hwndMain == NULL)
  425.         return 0;
  426.  
  427.     // $[PROTECT AppName + "WinMain"]$
  428.     // User Initialization stuff.
  429.     // $[ENDPROTECT]$
  430.  
  431.     // Can show it!
  432.     ShowWindow(g_hwndMain, g_nCmdShow);
  433.     UpdateWindow(g_hwndMain);
  434.  
  435.     // Main message loop...
  436.     MSG msg;
  437.  
  438.     while (GetMessage(&msg, 0, 0, 0)) {
  439.         if (TranslateAccelerator(g_hwndMain, g_haccel, &msg) == 0) { 
  440.             TranslateMessage(&msg);
  441.             DispatchMessage(&msg);
  442.         }
  443.     }
  444.  
  445.     // Return code from MSG struct...
  446.     return (int) msg.wParam;
  447. }
  448.  
  449.  
  450. // end of $[upper(AppSrcFile)]$
  451. $[//*********************************]$
  452. $[//*** Application Resource file ***]$
  453. $[//*********************************]$
  454. $[output AppPath + AppRrcFile]$
  455. $[AppHeader(AppRrcFile, "/" + "/")]$
  456.  
  457. #ifndef __$[upper(AppName)]$_RC
  458. #define __$[upper(AppName)]$_RC
  459.  
  460. // Specific includes.
  461. #include "$[AppHdrFile]$"
  462.  
  463. // Application icon.
  464. //$[AppName]$Icon ICON $[AppName]$.ico
  465.  
  466. // $[PROTECT AppName + "UserResources"]$
  467. // User Resources.
  468. // $[ENDPROTECT]$
  469.  
  470. //
  471. //  Main window menu.
  472. //
  473.  
  474. IDM_$[upper(AppName)]$MENU MENU 
  475. BEGIN
  476.  
  477.     POPUP "&File"
  478.     BEGIN
  479.         // $[PROTECT AppName + "UserFileMenuItems"]$
  480.         // User File Menu items.
  481.         // $[ENDPROTECT]$
  482.         MENUITEM "E&xit\aAlt+F4", IDM_FILEEXIT
  483.     END
  484.  
  485.     // $[PROTECT AppName + "UserPopupMenus"]$
  486.     // User Popup Menus.
  487.     // $[ENDPROTECT]$
  488.  
  489.     POPUP "&Help"
  490.     BEGIN
  491.         // $[PROTECT AppName + "UserHelpMenuItems"]$
  492.         // User Help Menu Items.
  493.         // $[ENDPROTECT]$
  494.         MENUITEM "&About $[AppName]$...", IDM_HELPABOUT
  495.     END
  496.  
  497. END
  498.  
  499.  
  500. //
  501. // Accelerator table.
  502. //
  503.  
  504. IDA_$[upper(AppName)]$ACCEL ACCELERATORS
  505. BEGIN
  506.     // $[PROTECT AppName + "UserAccelerators"]$
  507.     // User Accelerators.
  508.     // $[ENDPROTECT]$
  509.     "Q",   IDM_FILEEXIT,  VIRTKEY, CONTROL
  510. END
  511.  
  512.  
  513. //
  514. //  Dialogs.
  515. //
  516.  
  517. IDD_$[upper(AppName)]$ABOUT DIALOG 50, 50, 234, 133
  518. STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
  519. CAPTION "About $[AppName]$"
  520. FONT 8, "MS Sans Serif"
  521. BEGIN
  522.     CONTROL "$[AppName]$Icon", -1, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 4, 4, 18, 20
  523.     CONTROL "$[AppTitle]$", -1, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 28, 6, 150, 8
  524.     CONTROL "Version", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 28, 16, 26, 8
  525.     CONTROL "$[AppVersid]$", -1, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 55, 16, 122, 8
  526.     CONTROL "$[AppCopyright]$", -1, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 28, 26, 200, 8
  527.     CONTROL "This product is licensed to:", -1, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 28, 41, 200, 8
  528.     CONTROL "(UNREGISTERED)", IDC_$[upper(AppName)]$ABOUTNAME, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 28, 52, 200, 8
  529.     CONTROL "", IDC_$[upper(AppName)]$ABOUTCOMPANY, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 28, 62, 200, 8
  530.     CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 28, 77, 200, 1
  531.     CONTROL "$[AppInfo]$", -1, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 28, 80, 200, 32
  532.     CONTROL "Build date:", -1, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 28, 119, 38, 8
  533.     CONTROL "", IDC_$[upper(AppName)]$ABOUTBUILD, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 70, 119, 157, 8
  534.     CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 182, 4, 46, 14
  535.     CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 28, 115, 200, 1
  536. END
  537.  
  538.  
  539. #endif  // __$[upper(AppName)]$_RC
  540.  
  541. // end of $[upper(AppRrcFile)]$
  542. $[//******************************************]$
  543. $[//*** Application Module Definition file ***]$
  544. $[//******************************************]$
  545. $[output AppPath + AppDefFile]$
  546. NAME           $[AppName]$
  547. DESCRIPTION    '$[AppName]$ Application'
  548. STUB           'WINSTUB.EXE'
  549. EXETYPE        WINDOWS
  550. $[if AppGenDlg.Target.Select == 0 // Only for Windows 3.x]$
  551. CODE           PRELOAD MOVEABLE DISCARDABLE
  552. DATA           PRELOAD FIXED    MULTIPLE
  553. HEAPSIZE       8192
  554. STACKSIZE      8192
  555. $[else]$
  556. SUBSYSTEM      4.0
  557. $[endif // Win16/Win32]$
  558. $[// *** Close All Output! ***]$
  559. $[output ""]$
  560. $[// *** Remember Application Definition ***]$
  561. $[if (!saveitem(SaveFile, AppGenDlg))]$
  562.     $[msgbox("Error", "The dialog settings could not be saved to " + SaveFile, 16)]$
  563. $[endif]$
  564.